home *** CD-ROM | disk | FTP | other *** search
- # b_0 HermitDroid.cog
- #
- # A simple communiCog That I pioneered. -Doug
- #
- # Desc:
- #
- #
- # 12/08/97 DGS taken from JawaTalk.
- #-----------------------------------------------------------------------------
-
- symbols
- message converse
- message startup
- message user1
- message arrived
- message taken
- message timer
-
- thing Gonk
- thing player local
- template large_gear
- thing gear_ghost
-
- int Met=0 local
- int Joke=0 local
- int spoken_1=0 local
- int gears=0 local
- int ConversationActive=0 local
- int gonkcurframe=0 local
- int ResponseID local
- int message=0 local
- int thing_i=0 local
- int bat_i=18 local
- flex wait_time=1.3 local
- end
-
-
- code
- startup:
- hastalked=0;
- return;
- taken:
- if ((getsenderref() == thing_i)&&(dwgetarmstrength()>8) )
- {
- destroything(thing_i);
- SetInvAvailable(getlocalplayerthing(), 27, 1);// Add the large gear to the INV
- ChangeInv(getlocalplayerthing(), 27, 1);
- dwFlashInventory();
- timermode = 2;
- dwPlayCammySpeech(17309, "t9ca010.wav", 10, 0);
- settimer(10);
- }
- else {
- print("you're not strong enough to pick that up!");
- dwplaycammyspeech(16022, "m2ca022.wav", 20, 2);
- } return;
-
- converse:
- if ((getsenderref() == gonk) || (ConversationActive == 1))
- {
- # What response did the player select?
- ResponseID = dwGetPlayerResponse();
- print("conversation started!");
-
- if (ResponseID == 0 && !ConversationActive)
- {
- # Response 0 is reserved to indicate that a conversation is starting
- ConversationActive = 1;
- dwfreezeplayer();
- playsong(0,0,0);
- ResponseID = 1;
- playerpos=getthingpos(getlocalplayerthing());
- AISetMoveSpeed(gonk, 0);
- AISetLookPos(gonk, playerpos);
- }
-
- if (ResponseID == 1) #beginning Node
- {
- if (met == 2)
- {
- //dwSetDialogText("HDC002"); # Anything else
- dwplayplayerresponse();
- dwplaycharacterspeech("HDC002","T9GK003.wav");
- }
- if (met == 1)
- {
- //dwSetDialogText("HDC001"); # Hello
- dwplaycharacterspeech("HDC001","T9GK002.wav");
- met = 2;
- }
-
- if (met ==0)
- {
- //dwSetDialogText("HDC000"); # Greets
- dwplaycharacterspeech("HDC000","T9GK001.wav");
- met = 2;
- }
- dwAddResponse(100, "HDP100","T9xx007.wav",71); //# bridge move?
- if (gears == 0) dwAddResponse(200, "HDP200","T9xx008.wav",72); // # Gears?
- if (gears == 1) dwAddResponse(210, "HDP210","T9xx009.wav",73); // # Gears?
- if ((getdifficulty() == 0) && (joke == 0)) dwAddResponse(301, "HDP301","T6xx012.wav",72); // # Joke #1
- if ((getdifficulty() == 0) && (joke == 1)) dwAddResponse(300, "HDP305","T9xx013.wav",72); // # what are you doing here?
- if ((getdifficulty() == 1) && (joke == 0)) dwAddResponse(303, "HDP303","T9xx012.wav",72); // # Joke #2
- if ((getdifficulty() == 2) && (joke == 0)) dwAddResponse(305, "HDP303","T9xx012.wav",72); // # Joke #3
-
- //if (joke == 3) dwAddResponse(300, "HDP300"); // # Finally tell him
-
- dwAddResponse(400, "HDP400","IDxx222.wav",20); // # Goodbye.
- }
-
- if (ResponseID == 100) // # Bridge
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC100");
- dwPlayCharacterSpeech("HDC100", "T9Gk005.wav");
- dwAddResponse(1, "HDP001","T3xx002.wav",60); // Back to root node (ID 1);
- }
-
- if (ResponseID == 200) // # Gears #1
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC200");
- dwPlayCharacterSpeech("HDC200", "T9GK006.wav");
- dwAddResponse(210, "HDP210","T9xx009.wav",71);
- dwAddResponse(1, "HDP001","t3xx002.wav",60); // Thanks
- gears = 1;
- }
-
- if (ResponseID == 210) // Can I have the big gear?
- {
- //printint(GetInv(getlocalplayerthing(), 16));
- if (getdifficulty() != 2)
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC210"); // I need a battery
- dwPlayCharacterSpeech("HDC210", "T9GK007.wav");
- if (GetInv(getlocalplayerthing(), bat_i) > 0) //if battery inv bin is greater than 0
- {
- dwAddResponse(211, "HDP211","T9xx014.wav",30); // Deal
- dwAddResponse(212, "HDP212","T9xx015.wav",50); // Let me think about it
- }
- else
- {
- printint((GetInv(getlocalplayerthing(), bat_i)));
- dwAddResponse(213, "HDP213","T9xx016.wav",40); // I don't have any more.
- }
- }
- else // Else difficult does equal 2
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC215"); // I need a juice-up.
- dwPlayCharacterSpeech("HDC215", "T9GK008.wav");
- message = 0;
- if (dwCheckDroidCaps(65536))
- {
- // Juice Me Up
- dwAddResponse(216, "HDP211","T9xx014.wav",30); // It's a deal
- dwAddResponse(212, "HDP212","T9xx015.wav",60); // Let me think about it
- }
- else
- {
- // Need a Power plug
- //dwAddResponse(219, "HDP215");// I don't have a power plug
- dwAddResponse(219, "HDP215","T9xx018.wav",40); // I don't have a power plug
- }
- }
- }
-
- if (ResponseID == 216) // # It's a deal Part3
- {
- gears = 2;
- // TODO: ADD ANIMATION FOR THE HERMIT DROID OR ADDING TO THE INVENTORY
- print("adding item to bin 25");
-
- SetInvAvailable(getlocalplayerthing(), 27, 1);// Add the large gear to the INV
- ChangeInv(getlocalplayerthing(), 27, 1);
-
- // ChangeInv(getlocalplayerthing(), 16, -1);// Remove the battery from the INV
- //if (GetInv(getlocalplayerthing(), 16) == 0) //if battery inv bin is 0
- // {
- // SetInvAvailable(getlocalplayerthing(), 16, 0); // Remove the batt from the inv
- // }
- // TO DO: I remove power from POwer Droid's resources.
- dwplayplayerresponse();
- //dwSetDialogText("HDC216");
- dwPlayCharacterSpeech("HDC220", "T9GK019.wav");
- dwAddResponse(1, "HDP001","T3xx002.wav",30); // Return
- }
-
-
- if (ResponseID == 211) // # It's a deal Parts 1 and 2
- {
- dwplayplayerresponse();
- gears = 2;
- // TODO: ADD ANIMATION FOR THE HERMIT DROID OR ADDING TO THE INVENTORY
- print("adding item to bin 25");
- ChangeInv(getlocalplayerthing(), 18, -1);// Remove the battery from the INV
- dwcleardialog();
- //dwClearResponses();
- AISetLookFrame(gonk, 2);
- timermode = 1;
- settimer(1);
- //AISetMoveFrame(gonk, 1);
- }
-
-
- if (ResponseID == 212) // # No.
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC214");
- dwPlayCharacterSpeech("HDC214", "T9GK017.wav");
- dwAddResponse(1, "HDP000","T1xx014.wav",60); // Return
- }
-
- if (ResponseID == 213) // I don't have a battery
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC213");
- dwPlayCharacterSpeech("HDC219", "T9GK018.wav");
- dwAddResponse(1, "HDP000","T1xx014.wav",60); // Return
- }
-
- if (ResponseID == 219) // # I don't a plug/generator
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC219");// COme back when you have one
- dwPlayCharacterSpeech("HDC216", "T9GK020.wav");
- dwAddResponse(1, "HDP000","T1xx014.wav",60); // Return
- }
-
- if (ResponseID == 300) // # FInally tell him
- {
- joke = 4;
- dwplayplayerresponse();
- //dwSetDialogText("HDC300");
- dwPlayCharacterSpeech("HDC300", "T9GK009.wav");
- dwAddResponse(1, "HDP001","T1xx014.wav",60); // Return
- }
- //-----------------======================================== JOKE SECTION
- if (ResponseID == 301) // Joke #1 Setup
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC301");
- dwPlayCharacterSpeech("HDC301", "T9GK010.wav");
- dwAddResponse(302, "HDP002","T9xx003.wav",73); // Return
- }
-
- if (ResponseID == 302) // Joke #1 Punchline
- {
- joke = 1;
- dwplayplayerresponse();
- //dwSetDialogText("HDC302");
- dwPlayCharacterSpeech("HDC302", "T9GK011.wav");
- dwAddResponse(1, "HDP003","T9xx004.wav",50); // Return
- dwAddResponse(1, "HDP004","T9xx005.wav",40); // Return
- }
-
-
- if (ResponseID == 303) // Joke #2 Setup
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC303");
- dwPlayCharacterSpeech("HDC303", "T9GK012.wav");
- dwAddResponse(304, "HDP006","T9xx006.wav",73); // Return
- }
-
- if (ResponseID == 304) // Joke #2 Punchline
- {
- joke = 3;
- dwplayplayerresponse();
- //dwSetDialogText("HDC304");
- dwPlayCharacterSpeech("HDC304", "T9GK013.wav");
- dwAddResponse(1, "HDP003","T9xx004.wav",50); // Return
- dwAddResponse(1, "HDP004","T9xx005.wav",40); // Return
- }
-
-
- if (ResponseID == 305) // Joke #3 Setup
- {
- dwplayplayerresponse();
- //dwSetDialogText("HDC305");
- dwPlayCharacterSpeech("HDC305", "T9GK014.wav");
- dwAddResponse(306, "HDP010","T7xx018.wav",73); // Return
- }
-
- if (ResponseID == 306) // Joke #3 Punchline
- {
- joke = 4;
- dwplayplayerresponse();
- //dwSetDialogText("HDC306");
- dwPlayCharacterSpeech("HDC306", "T9GK015.wav");
- dwAddResponse(1, "HDP003","T9xx004.wav",50); // Return
- dwAddResponse(1, "HDP004","T9xx005.wav",40); // Return
- }
-
- if (ResponseID == 400) // # bye
- {
- dwplayplayerresponse();
- //dwSetDialogText("JAC401");
-
- dwCleardialog();
- // Terminate the conversation
- met = 1; //Reset the greeting
- ConversationActive=0;
- ShuffleTracks(2, 3, 4, 5);
- dwunfreezeplayer();
- }
- }
- return;
-
- arrived:
-
-
- timer:
- // Used to create the large gear.
- if (timermode == 1)
- {
- thing_i = creatething(large_gear,gear_ghost);
- capturething(thing_i);
- AISetLookFrame(gonk, 1);
- if (GetInv(getlocalplayerthing(), bat_i) == 0) //if battery inv bin is 0
- {
- SetInvAvailable(getlocalplayerthing(), bat_i, 0); // Remove the batt from the inv
- }
- //dwSetDialogText("HDC211");
- dwplaycharacterspeech("HDC211","T9GK016.wav");
- dwAddResponse(1, "HDP001","T3xx002.wav",60); // Return
- }
- else if (timermode == 2)
- {
- //nothing anymore
- }
-
- return;
- return;
- end
-
-
-